/**
 * Copyright 2011 By Shayne, Zhang.
 * 
 * The contents of this file are developped by Shayne, Zhang. You may visit:
 * http://www.shaynez.com for more details.
 *
 */
package com.shaynez.ec.element;

import com.shaynez.ec.exception.InvalidateValueException;

/**
 * @author shayne zhang
 *
 */
public interface Calculatable<T> {
	/**
	 * For all the exposure elements, we make this rule when compare 2 of them.
	 * 
	 * Whichever makes exposure more, whichever is bigger. That means:
	 * f1 compare f1.4 = 2 because f1 is 2 times bigger than f1.4
	 * iso200 compare iso 100 = 2
	 * shutter 2s compare 1s =2
	 * Sunset is bigger than cloudy.
	 * 
	 * @param o
	 * @return
	 */
	public Factor compare(T o);
	
	
	
	/**
	 * Return a new Element object with the factor value.
	 * 
	 * when factor is 2:
	 * 
	 * f1 returns f1.4
	 * iso200 returns iso100
	 * shutter 2s returns 1s
	 * 
	 * 
	 * @param factor
	 * @return
	 */
	public T calculate(Factor factor) throws InvalidateValueException;
}
